package games.gameObjects;

import gameUtils.Coordinate;
import gameUtils.GameMath;

import java.awt.Point;
import java.io.IOException;

import pt.iul.poo.image.SimpleImage;

public class Path extends SimpleTDObject implements Comparable<Path> {

	public static final String TD_CLASS = "Path"; 
	public static final int PRIORITY = 10; 
	private SimpleImage image;
	private int index;

	public Path(final Coordinate c, final int index){
		super(c, PRIORITY);
		this.index = index;

		try {
			Point p = GameMath.convertToPoint(c);
			image = new SimpleImage("Images//Gray.png",(int)p.getX(),(int)p.getY(),PRIORITY);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public int getIndex() {
		return index;
	}
	
	@Override
	public SimpleImage getImage() {
		return this.image;
	}
	
	@Override
	public String toString() {
		return getTDClass();
	}
	@Override
	public String getTDClass() {
		return TD_CLASS;
	}

	@Override
	public int compareTo(final Path other) {
		return index - other.getIndex();
	}
}
